Single grouped weight fixes#3225
Conversation
Signed-off-by: CarlosGomes98 <carlosmiguel.gomes@live.com.pt>
Signed-off-by: CarlosGomes98 <carlosmiguel.gomes@live.com.pt>
Signed-off-by: CarlosGomes98 <carlosmiguel.gomes@live.com.pt>
Greptile SummaryThis PR delivers three targeted bug fixes to the single-grouped-weight path introduced in #3178: it preserves the per-weight high-precision initialization values when packing discrete weights into a
Confidence Score: 5/5The three fixes are well-scoped and each has a dedicated regression test; no existing behaviour is altered for the non-single-grouped-weight paths. All three fixes are narrowly targeted at the single-grouped-weight path, the logic is straightforward, and each change is covered by a new test. The set_usage(columnwise=None) change correctly exploits the existing guard in the quantizer. The _high_precision_init_val stacking is safe and cleans up after itself. The register_parameter override guards with getattr for pre-init access. No regressions to unrelated paths. No files require special attention; the changes are localized and well-tested. Important Files Changed
Reviews (2): Last reviewed commit: "Fix bug where grouped MLP used same quan..." | Re-trigger Greptile |
|
/te-ci pytorch L1 |
|
/te-ci pytorch L1 |
| # Full-iteration CUDA graph replay does not rerun this Python metadata | ||
| # update. Remember that a grad-enabled forward requested columnwise | ||
| # storage so eager eval cannot drop buffers still used by captured dgrad. | ||
| fc1_weight_quantizer.set_usage( | ||
| rowwise=True, | ||
| columnwise=input_requires_grad or fc1_weight_quantizer.columnwise_usage, | ||
| ) | ||
| fc1_op.weight.quantizer = fc1_weight_quantizer | ||
| grouped_fc1_weight = fc1_op.weight |
There was a problem hiding this comment.
The op and the param purposely have different quantizers so that you can change them independently. However, we are incorrectly reusing the same quantizer in two places, and getting unexpected interactions. The op's quantizer is set in each forward pass:
The proper fix is keep the op and param quantizers distinct.
…d weight param Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
|
/te-ci pytorch |
Description
A few fixes to the single grouped weight implementation
12406c9 — Preserve grouped weight initialization metadata
99b3f37 — Mark late grouped weights for delayed wgrad
aa4e233 — Preserve grouped MXFP8 columnwise usage
See #3178 for the original PR.
PR #3224 is very relevant to this one, both are required fixes.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: